<?php

class RepresentanteController extends BaseController
{
   
    public function indexAction(){
        $this->view->index;
        
        $id = $this->getLoggedUser()->id;
        $model = new Application_Model_Usuario();
    	$usuario = $model->fetchAll("id = $id")->current();
    	
    	
    	$camposusuarios = $usuario->toArray();
    	$this->view->id = $camposusuarios['id']; 
    	
    }
    
	public function cadastrarAction(){
		    	
    	$model = new Application_Model_Usuario();
    	        
    	$this->view->form = new Form_Recadastro_representante();
    	
    	$modelufrg = new Application_Model_Ufrg();
    	$modelsexo = new Application_Model_sexo();
    	
    	$this->view->form->ufrg->addMultiOptions($modelufrg->getArrayUfrg());
    	$this->view->form->sexo->addMultiOptions($modelsexo->getArraysexo());
    	
		
		
		if ($this->_getParam('Próximo')){
			$this->_cadastrarUsuarioOrgao($this->getRequest()->getParams());
       	}
		if ($this->_getParam('Gravar')){
    		$arraygravar = $this->_getAllParams();
    		$arrayeditar = $_SESSION['parametros']['parametro'];
    		$unirarray = array_merge($arrayeditar,$arraygravar); 
    		$this->_salvar($unirarray);
       	}
		
	}
    
   
    
    
}
?>
